<template>
  <div class="organizational-psychology-scene">
    <div class="container">
      <div class="interweaving-lines"></div>
      <div class="floating-elements">
        <div class="floating-element"></div>
        <div class="floating-element"></div>
        <div class="floating-element"></div>
        <div class="floating-element"></div>
      </div>

      <!-- 返回按钮 -->
      <button class="back-btn" @click="goBack">
        <i class="fas fa-arrow-left"></i>
      </button>

      <div class="content">
        <div class="header">
          <div class="main-title">
            <span class="title-line title-line1">您的组织，</span>
            <span class="title-line title-line2">是否也曾经历这样的场景：</span>
          </div>
        </div>

        <div class="scenarios">
          <button class="scenario-btn" @click="handleScenarioClick(1)">
            <div class="scenario-icon">
              <i class="fas fa-exclamation-triangle"></i>
            </div>
            <div class="scenario-text">
              <div class="scenario-number">场景一</div>
              <div class="scenario-title">组织变革引爆隐性危机的王静</div>
            </div>
          </button>

          <button class="scenario-btn" @click="handleScenarioClick(2)">
            <div class="scenario-icon">
              <i class="fas fa-life-ring"></i>
            </div>
            <div class="scenario-text">
              <div class="scenario-number">场景二</div>
              <div class="scenario-title">职场里无声呼救的小陈</div>
            </div>
          </button>

          <button class="scenario-btn" @click="handleScenarioClick(3)">
            <div class="scenario-icon">
              <i class="fas fa-bolt"></i>
            </div>
            <div class="scenario-text">
              <div class="scenario-number">场景三</div>
              <div class="scenario-title">重大事件影响下的林聪</div>
            </div>
          </button>
        </div>

        <div class="footer">组织心理风险管理系统</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "OrganizationalPsychologyScene",
  methods: {
    handleScenarioClick(scenarioNumber) {
      // 添加点击反馈
      const btn = event.currentTarget;
      btn.style.transform = "scale(0.98)";

      setTimeout(() => {
        btn.style.transform = "";
      }, 200);

      // 获取场景标题
      const scenarioTitle = btn.querySelector(".scenario-title").textContent;
      if (scenarioNumber == "1") {
        this.$router.push({ path: "/trial/changjing1" });
      }
      if (scenarioNumber == "2") {
        this.$router.push({ path: "/trial/changjing2" });
      }
      if (scenarioNumber == "3") {
        this.$router.push({ path: "/trial/changjing3" });
      }
    },

    goBack() {
      // 添加点击反馈
      const btn = event.currentTarget;
      btn.style.transform = "scale(0.9)";

      setTimeout(() => {
        btn.style.transform = "";
      }, 200);

      // 在实际应用中，这里可以返回上一页
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped>
.organizational-psychology-scene {
  background: linear-gradient(135deg, #b0d4f2 0%, #f5d1e0 100%);
  color: #2d467b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.container {
  width: 85%;
  background-color: rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(85, 145, 220, 0.12);
  padding: 30px 25px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(178, 212, 242, 0.2) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(245, 209, 224, 0.2) 0%,
      transparent 50%
    );
  z-index: 0;
}

.content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  margin-bottom: 25px;
}

.main-title {
  font-weight: bold;
  font-size: 18px;
  color: #2d467b;
  line-height: 1.5;
  margin-bottom: 25px;
  position: relative;
  padding: 0 10px;
}

.title-line {
  display: block;
}

.title-line1 {
  margin-bottom: 5px;
}

.main-title::before,
.main-title::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, transparent, #6ba1e4, transparent);
  left: 50%;
  transform: translateX(-50%);
}

.main-title::before {
  top: -8px;
}

.main-title::after {
  bottom: -8px;
}

.scenarios {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  justify-content: flex-start;
}

.scenario-btn {
  background: linear-gradient(
    to right,
    rgba(107, 161, 228, 0.7),
    rgba(74, 123, 200, 0.7)
  );
  color: white;
  border: none;
  border-radius: 20px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(85, 145, 220, 0.2);
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.scenario-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.scenario-btn:hover::before {
  left: 100%;
}

.scenario-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(85, 145, 220, 0.25);
}

.scenario-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.scenario-icon i {
  color: white;
  font-size: 16px;
}

.scenario-text {
  flex: 1;
  line-height: 1.4;
}

.scenario-number {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.scenario-title {
  font-size: 15px;
  font-weight: bold;
}

.footer {
  margin-top: 20px;
  color: #4a7bc8;
  font-size: 14px;
  opacity: 0.8;
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}

.floating-element {
  position: absolute;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: float 15s infinite linear;
}

.floating-element:nth-child(1) {
  width: 12px;
  height: 12px;
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  width: 8px;
  height: 8px;
  top: 75%;
  left: 15%;
  animation-delay: 2s;
}

.floating-element:nth-child(3) {
  width: 16px;
  height: 16px;
  top: 40%;
  left: 85%;
  animation-delay: 4s;
}

.floating-element:nth-child(4) {
  width: 6px;
  height: 6px;
  top: 85%;
  left: 80%;
  animation-delay: 6s;
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

.interweaving-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  opacity: 0.1;
  background: linear-gradient(
      45deg,
      transparent 48%,
      #6ba1e4 49%,
      #6ba1e4 51%,
      transparent 52%
    ),
    linear-gradient(
      -45deg,
      transparent 48%,
      #f5a9c5 49%,
      #f5a9c5 51%,
      transparent 52%
    );
  background-size: 40px 40px;
}

/* 返回按钮样式 */
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(
    to right,
    rgba(107, 161, 228, 0.7),
    rgba(74, 123, 200, 0.7)
  );
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(85, 145, 220, 0.2);
  transition: all 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(85, 145, 220, 0.3);
}

.back-btn:active {
  transform: scale(0.95);
}

.back-btn i {
  font-size: 14px;
}
</style>
